home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / repeat20.zip / REPEAT.DOC next >
Text File  |  1994-10-26  |  4KB  |  93 lines

  1.                                   REPEAT v2.0
  2.  
  3.  
  4.                             (c) 1991 by Ben Bernard
  5.  
  6.  
  7.  
  8.   The original idea of REPEAT was to allow you to apply a single command to
  9. multiple files.  This is needed for such commands as TYPE, which doesn't
  10. accept wildcards.  The solution was REPEAT TYPE # FOR *.TXT.  In using v 1.0
  11. I found many other things which I thought should be added.  You can see
  12. the result below.  Macro substitutions allow REPEAT to perform complex
  13. decisions based on variables related to the files being processed.
  14.   REPEAT is really a prototype, written with MS BASIC PDS 7.1, of a future
  15. program to be implemented in C when I get time to do so.  In the meantime,
  16. if I have left what you deem to be a useful feature out of REPEAT, drop me
  17. a line at the adresses listed at the end.
  18.   Legal stuff:  You use this program AT YOUR OWN RISK.  By using REPEAT, you
  19. agree to absolve me of all claims for damage to any hardware, software, or
  20. data which might be caused by this program.  You are hereby granted license to
  21. use REPEAT for any use and any period of time, provided you do not modify the
  22. code in any way.  This software may be distributed only in its original and
  23. complete package, either in the original ZIP file or in an equivalent archive.
  24. No fee can be charged for this software.  Disk duplicators and BBSs may,
  25. however, charge a fee for their services.
  26.  
  27.  
  28. Usage:  REPEAT {command} FOR {filespec} IF {mask}
  29.   {command} will be executed once for each file in {filespec} for which
  30.   {mask} evaluates to true.
  31. {command} can contain any DOS command, plus the macros listed below.
  32. {filespec} can have full pathname and more (see docs).
  33. {mask} can contain any of the macros and operators below.
  34.  
  35. Macros:                     Operators:
  36.   $bd   space on drive d       {       }    =     @  &   !
  37.   $d    file drive             greater less equal or and not
  38.   $e    extension
  39.   $f    filename
  40.   $n    basename 
  41.   $p    file path
  42.   $s    file size
  43.   $t    file time
  44.   $y    file date
  45.   $[  ] left justify macros between [ ]
  46.   $r  ] right justify macros between r ]
  47.   $c  ] center macros between c ]
  48.   $$    $
  49.   $,    <  \
  50.   $.    >   }these must be used to delay DOS redirection
  51.   $\    |  /
  52.  
  53.  
  54.  
  55. Some details:
  56. The entire list of files matching filespecs is loaded before any execution
  57.   takes place.  This is done to prevent looping, and may change in future
  58.   versions.
  59. To use DOS redirection within {command} you must use the $, $. and $\ macros.
  60. Multiple filespecs can be included in {filespec} by separating them with commas.
  61. The disk space macro ($b) can accept the file drive macro ($d) as a parameter.
  62. The justification macros ($[ $r $c) pack as many spaces in as there are
  63.   characters between the macro and the terminator (exclusive).  The space
  64.   between can contain other macros, EXCEPT other justification macros.
  65. The comparason operators treat dates specially so that they will be handled
  66.   properly.
  67. Pressing <ESC> during exeution will result in REPEAT pausing when it regains
  68.   control, at which time you can decide to abort REPEAT or continue.
  69. Nothing in REPEAT is case sensitive.
  70.  
  71.  
  72. Examples:
  73.  
  74. repeat echo $[$f          ]  $r$s       ]  $y  $t for *.* if $y=10-11-1990
  75.    Produces a DOS-like directory of all files with date 10-11-1990.
  76.  
  77. repeat copy $f a:\ for *.* if $ba}$s
  78.    Copies files from current directory to drive a as long as there is space
  79.    for them.  Note that the disk space check is done dynamically, so that
  80.    as each file is copied onto drive a, the space available is adjusted
  81.    accordingly.
  82.  
  83. repeat del $n.bas for *.obj
  84.   Deletes .BAS files with same basename as existing .OBJ files.
  85.  
  86.  
  87. Suggestions, donations, feedback, or just plain comments can be addressed to:
  88.  
  89. InterNet:    ben.bernard@channel1.com
  90. SnailMail:   Ben Bernard
  91.              POB 366
  92.              Celeste, TX 75423-0366
  93.